Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Embed Block #111

Merged
merged 14 commits into from
Jan 22, 2024
Merged

feature: Embed Block #111

merged 14 commits into from
Jan 22, 2024

Conversation

jbmoelker
Copy link
Member

@jbmoelker jbmoelker commented Jan 14, 2024

Changes

  • Adds an Embed Block that renders external content based on the block's OEmbed data.
    • Supports ~300 content providers (like Twitter, Flickr, YouTube, etc) using the OEmbed protocol.
    • Renders a noscript embed version which is dynamically enhanced.
    • Lazy loads embed scripts and iframes to improve performance.
    • Provides a mechanism to define custom renderer per provider.
    • Adds specific implementations for Twitter, YouTube and Vimeo (the last two reusing the Video Embed Block).
    • If OEmbed data is unavailable, a link is displayed with the page title of the given URL.
    • Embed Block data is preloaded in the CMS using the DatoCMS OEmbed Plugin.

Associated issue

Resolves #107

How to test

  1. Open preview link
  2. Navigate to page with embeds
  3. Verify the different embeds are rendered correctly
  4. Verify embeds are lazy loaded when scrolled into view
  5. Verify embeds show a basic (non-enhanced) version when JS is disabled
  6. Review Embed Block model in the CMS
  7. Add an Embed Block to a page
  8. Verify a preview is displayed and the embed data is set
  9. Verify the new embed is rendered on the page

Checklist

  • I have performed a self-review of my own code
  • I have made sure that my PR is easy to review (not too big, includes comments)
  • I have made updated relevant documentation files (in project README, docs/, etc)
  • I have added a decision log entry if the change affects the architecture or changes a significant technology
  • I have notified a reviewer

Copy link

cloudflare-workers-and-pages bot commented Jan 15, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 351e94a
Status: ✅  Deploy successful!
Preview URL: https://0c14213c.head-start.pages.dev
Branch Preview URL: https://feat-embed-block.head-start.pages.dev

View logs

@jbmoelker jbmoelker marked this pull request as ready for review January 22, 2024 18:43
@jbmoelker jbmoelker merged commit 3e00e91 into main Jan 22, 2024
4 checks passed
@jbmoelker jbmoelker deleted the feat/embed-block branch January 22, 2024 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Social media embeds
1 participant